﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:my="clr-namespace:Microsoft.PowerShell.CmdletManagement" 
    x:Class="Microsoft.PowerShell.CmdletManagement.ExtendedCheckBox" 
    x:Name="root" >
	<Grid  Margin="5,5,15,5">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="20"  />
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

		<CheckBox Name="CheckBox"  Grid.Row="0" Grid.Column="0" Margin="0,5,0,0"
            Checked="ValueChanged"
            Unchecked="ValueChanged" >
            <CheckBox.IsChecked>
                <Binding Path="Value" ElementName="root">
                    <Binding.ValidationRules>
                        <my:TriStateValidationRule />
                    </Binding.ValidationRules>
                </Binding>
            </CheckBox.IsChecked>
        </CheckBox>
		<TextBlock TextWrapping="Wrap" Grid.Row="0" Grid.Column="1"  Text="{Binding Label, ElementName=root}" Margin="0,3,10,0" />
		<TextBlock VerticalAlignment="Top" HorizontalAlignment="Left"
        TextWrapping="Wrap" Margin="15,3,0,0" Grid.Row="1" Grid.ColumnSpan="2" Text="{Binding HelpText, ElementName=root}"
			Foreground="{DynamicResource HelpTextFontColor}" />
    </Grid>
</UserControl>
